<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core"
	xmlns:c="http://java.sun.com/jstl/core"
	xmlns:s="http://jboss.com/products/seam/taglib">
	
	<h:column rendered="#{rendered}">
		
		<c:choose>
			<c:when test="#{type == 'Date'}">
				<h:outputText value="#{value}">
					<s:convertDateTime type="date" pattern="#{messages['DatePattern']}"/>
				</h:outputText>
			</c:when>
			
			<c:when test="#{type == 'Time'}">
				<h:outputText value="#{value}">
					<s:convertDateTime type="time" pattern="#{messages['TimePattern']}"/>
				</h:outputText>
			</c:when>
			
			<c:when test="#{type == 'Timestamp'}">
				<h:outputText value="#{value}">
					<s:convertDateTime type="both"
						pattern="#{messages['TimestampPattern']}"/>
				</h:outputText>
			</c:when>
			
			<c:when test="#{type == 'Boolean'}">
				<h:selectBooleanCheckbox disabled="true"
					value="#{value}"/>
				<ui:remove>
					<h:outputText value="#{value}">
						<f:converter
							converterId="rad.framework.jsf.YesNoConverter"/>
					</h:outputText>
				</ui:remove>
			</c:when>
			
			<c:when test="#{type == 'Integer'}">
				<h:outputText value="#{value}"/>
			</c:when>
			
			<c:when test="#{type == 'Decimal'}">
				<h:outputText value="#{value}"/>
			</c:when>
			
			<c:when test="#{type == 'Currency'}">
				<h:outputText value="#{value}">
					<f:convertNumber type="currency"
						currencySymbol="#{messages['CurrencySymbol']}"/>
				</h:outputText>
			</c:when>
			
			<c:when test="#{type == 'Percent'}">
				<h:outputText value="#{value}">
					<f:convertNumber type="percent" maxFractionDigits="4"/>
				</h:outputText>
			</c:when>
			
			<c:when test="#{type == 'Link'}">
				<h:outputLink id="#{id}Link" value="#{facesContext.externalContext.request.contextPath}#{value}" target="_blank"
					rendered="#{rendered and not empty value}">
					<h:outputText id="#{id}Text" value="#{text}"
						rendered="#{not empty text}"/>
					<h:outputText id="#{id}Text2" value="#{value}"
						rendered="#{empty text}"/>
				</h:outputLink>
				<h:outputText id="#{id}TextOnly" value="#{text}"
					rendered="#{rendered and empty value}"/>
			</c:when>
			
			<c:when test="#{type == 'Image'}">
				<h:graphicImage value="#{value}"
					rendered="#{rendered and not empty value}"/>
			</c:when>
			
			<c:when test="#{type == 'Enum'}">
				<h:outputText value="#{value}">
					<f:converter
						converterId="rad.framework.jsf.EnumOutputConverter"/>
				</h:outputText>
			</c:when>
			
			<c:when test="#{type == 'TextArea'}">
				<s:formattedText value="#{value}"/>
			</c:when>
			
			<c:otherwise>
				<h:outputText escape="false" value="#{value}"/>
			</c:otherwise>
		</c:choose>
	</h:column>
	
</ui:composition>
